=========================================================================== BBS: The Abacus * HST/DS * Potterville, MI Date: 03-08-93 ( : ) Number: 254 From: SCOTT BAILEY Refer#: NONE To: ALL Recvd: NO Subj: patterns Conf: (35) Quick Basi --------------------------------------------------------------------------- Here's something I whipped-up a long time ago just for fun. --------------shnipp--------- 'BALLPTRN.BAS by Scott Bailey 'public domain 'draws patterns by XORing the ball bouncing off the walls 'QBS: YES 'hitting the spacebar starts a different pattern DEFINT A-Z RANDOMIZE TIMER SCREEN 12 CLS CIRCLE (10, 10), 2, 3 CIRCLE (10, 10), 1, 9 DIM fly(0 TO 19) GET (7, 7)-(12, 12), fly restart: CLS FOR h = 0 TO 639 STEP 10 LINE (0, h)-(639, h), 4 LINE (h, 0)-(h, 479), 4 NEXT LINE (0, 0)-(639, 479), 4, B direction = INT(RND * 4) + 1 x = RND * 300 + 10 y = RND * 460 + 10 DO a$ = INKEY$ IF a$ = CHR$(27) THEN END IF a$ = " " THEN GOTO restart SELECT CASE direction CASE 1 x = x + 4 y = y - 4 CASE 2 y = y + 4 x = x + 4 CASE 3 x = x - 4 y = y + 4 CASE 4 x = x - 4 y = y - 4 END SELECT IF x > 620 OR x < 20 OR y > 460 OR y < 20 THEN SELECT CASE direction CASE 1 direction = 2 CASE 2 direction = 3 CASE 3 direction = 4 CASE 4 direction = 1 END SELECT END IF PUT (x, y), fly LOOP ----------schnapp----------- --- DLG Pro v0.995/DLGMail * Origin: Computer Answers, Prince Albert, Sask., Canada (1:140/601) SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1 SEEN-BY: 153/752 154/40 77 157/2 159/100 125 430 950 203/23 209/209 280/1 SEEN-BY: 390/1 396/1 15 397/2 2230/100 3603/20